<?php

namespace app\admin\model\books;

use think\Model;

use app\admin\model\Type;
class Book extends Model
{

    

    

    // 表名
    protected $name = 'book';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];
    public function typeList(){
        return $this->belongsTo('app\admin\model\Type','id','tid',[],'LEFT')->setEagerlyType(0);
    }
    public function types(){
        return $this->hasOne('Type','id','tid');
    }
    

    







}
